var loadedEntities;
loadedEntities = false;
while(!loadedEntities)
{
    entsTag = readLine();
    switch(entsTag.name)
    {
        case "entity":
            loadEntity();
        break;
        
        case "/entities":
            loadedEntities = true;
        break;
    }
    
    if (!loadedEntities)
    {
        nextLine();
    }
}
